package utils

import "fmt"

func init() {
	fmt.Println("utils init")
}

func Calculate(n1 float64, n2 float64, operator string) float64 {
	var result float64
	switch operator {
	case "+":
		result = n1 + n2
	case "-":
		result = n1 - n2
	case "*":
		result = n1 * n2
	case "/":
		result = n1 / n2
	default:
		fmt.Println("Invalid operator: ", operator)
	}
	return result
}
